import {
  defaultProperties,
  dashboardProperties,
  informationProperties,
  chartLineProperties,
  pieProperties,
  radarProperties,
  gaugeProperties,
  funnelProperties,
  chartBarProperties,
  myTaskProperties,
  todoListProperties,
  modulesProperties,
} from './properties';
import { DesktopComponent } from '/@/enums/desktop';
import {
  ChartBarInfo,
  DesktopInfoItem,
  MixLineBarInfo,
  PieItemInfo,
} from '/@/model/desktop/designer';
// 默认属性
export const defaultInfo = {
  x: 0,
  y: 0,
  i: '0',
  w: 2,
  h: 2,
  minW: 2,
  minH: 2,
  maxW: 12,
  maxH: 2,
  type: DesktopComponent.DASHBOARD,
  config: {
    ...defaultProperties,
  },
};

//数据面板
export const dashboardInfo = {
  x: 0,
  y: 0,
  i: '0',
  w: 2,
  h: 3,
  minW: 2,
  minH: 3,
  maxW: 12,
  maxH: 4,
  type: DesktopComponent.DASHBOARD,
  config: {
    ...dashboardProperties,
  },
};

//信息列表
export const informationInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 4,
  minH: 6,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.INFORMATION,
  config: {
    ...informationProperties,
  },
};

//折线/柱状图
export const chartLineInfo: MixLineBarInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 6,
  minH: 8,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.CHARTLINE,
  config: chartLineProperties,
};

//饼图
export const pieInfo: PieItemInfo = {
  x: 0,
  y: 0,
  w: 4,
  h: 6,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.PIE,
  config: {
    ...pieProperties,
  },
};

//雷达图

export const radarInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.RADAR,
  config: {
    ...radarProperties,
  },
};

//仪表盘

export const gaugeInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.GAUGE,
  config: {
    ...gaugeProperties,
  },
};

//漏斗图

export const funnelInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 6,
  minH: 6,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.FUNNEL,
  config: {
    ...funnelProperties,
  },
};

//柱状百分比

export const chartBarInfo: ChartBarInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 10,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.CHARTBAR,
  config: {
    ...chartBarProperties,
  },
};
//我的任务

export const myTaskInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 4,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.MYTASK,
  config: {
    ...myTaskProperties,
  },
};

//待办事项

export const todoListInfo = {
  x: 0,
  y: 0,
  w: 6,
  h: 4,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.TODOLIST,
  config: {
    ...todoListProperties,
  },
};

//常用功能

export const modulesInfo = {
  x: 0,
  y: 0,
  w: 12,
  h: 4,
  i: '0',
  minW: 4,
  minH: 4,
  maxW: 12,
  maxH: 12,
  type: DesktopComponent.MODULES,
  config: {
    ...modulesProperties,
  },
};

// 获取组件属性
export const InfoByType: Map<DesktopComponent, DesktopInfoItem> = new Map([
  [DesktopComponent.DASHBOARD, dashboardInfo],
  [DesktopComponent.INFORMATION, informationInfo],
  [DesktopComponent.CHARTLINE, chartLineInfo],
  [DesktopComponent.PIE, pieInfo],
  [DesktopComponent.RADAR, radarInfo],
  [DesktopComponent.GAUGE, gaugeInfo],
  [DesktopComponent.FUNNEL, funnelInfo],
  [DesktopComponent.CHARTBAR, chartBarInfo],
  [DesktopComponent.MYTASK, myTaskInfo],
  [DesktopComponent.TODOLIST, todoListInfo],
  [DesktopComponent.MODULES, modulesInfo],
]);
